<?php

// This file is part of the Carrington Mobile Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }

?>
<b><?php the_title(); ?></b>
	
<?php
	$postid = get_the_ID();
	echo '<br/>Lượt xem: ';
	echo_post_views($postid );
	$Price=get_post_meta($postid,'Price',true); 
	if($Price){
		echo '<br/>Giá: ';
		echo $Price.'<img src="'.get_bloginfo('siteurl').'/wp-content/uploads/2011/07/iexc.gif" width="12px" height="12px"/>';
	}
	switch($Price){
		case 500:
			$sms='7049';
			break;
		case 1000:
			$sms='7149';
			break;
		case 5000:
			$sms='7549';
			break;
		case 10000:
			$sms='7649';
			break;
		case 15000:
			$sms='7749';
			break;
		default:
			$sms='7049';
			break;
	}
	$Intro=get_post_meta($postid,'Introduction',true); 
	$File1=get_post_meta($postid,'File Upload 1',true);
	$Down1=get_post_meta($postid,'Download 1',true);
	$meta_value1=get_post_meta($File1,'_wp_attached_file',true);
	if($meta_value1){
	echo '<br/><a href="sms:'.$sms.'?body=WAP '.$File1.'"><img src="'.get_bloginfo('siteurl').'/wp-content/uploads/2011/07/icon_download.gif" width="12px" height="12px"/>Tải về 1</a>';
		echo ' - Lượt tải: '.$Down1;
	}
	$File2=get_post_meta($postid,'File Upload 2',true); 
	$Down2=get_post_meta($postid,'Download 2',true);
	$meta_value2=get_post_meta($File2,'_wp_attached_file',true);
	if($meta_value2){
	echo '<br/><a href="sms:'.$sms.'?body=WAP '.$File2.'"><img src="'.get_bloginfo('siteurl').'/wp-content/uploads/2011/07/icon_download.gif" width="12px" height="12px"/>Tải về 2</a>';
	echo ' - Lượt tải: '.$Down2;
	}
	$File3=get_post_meta($postid,'File Upload 3',true); 
	$Down3=get_post_meta($postid,'Download 3',true);
	$meta_value3=get_post_meta($File3,'_wp_attached_file',true);
	if($meta_value3){
	echo '<br/><a href="sms:'.$sms.'?body=WAP '.$File3.'"><img src="'.get_bloginfo('siteurl').'/wp-content/uploads/2011/07/icon_download.gif" width="12px" height="12px"/>Tải về  3</a>';
	echo ' - Lượt tải: '.$Down3;
	}
	echo '<br/><i>'.$Intro.'</i>';
	the_content();

$args = array(
	'before' => '<p class="pages-link">'. __('Pages: ', 'carrington-mobile'),
	'after' => "</p>\n",
	'next_or_number' => 'number'
);
	
wp_link_pages($args);
?>

<div class="clear"></div>

<p class="byline small">Đăng bởi <?php the_author_posts_link(); ?> - <?php the_date('Y-m-d H:i:s'); ?></p>

<?php the_tags('<p class="tags small">Tags: ',', ','</p>'); ?>

<p class="categories small"><?php _e('Danh Mục: '); the_category(', '); ?></p>